<template>
  <div id="login">
    <div class="title">
      <h1>请填写邀请码进入企业或自主创建企业</h1>
    </div>
    <div class="box" style="height:440px">
        <el-form
        label-width="180px">
            <el-form-item label="邀请码:">
                <el-input v-model="code" placeholder="请输入邀请码">
                </el-input>
                <el-button type="success"
                 style="width:50%; font-size:20px; height:45px; margin:25px 10px;"
                 @click="Submit"
                 >进 入 企 业</el-button>
            </el-form-item>
        </el-form>
         <el-divider style="width:30px"></el-divider>
        <el-form
        label-width="180px">
        <el-form-item >
                 <el-button 
                 type="danger"
                 style="width:50%; font-size:20px; height:45px; margin:15px 10px;"
                 @click="Created"
                 >创 建 企 业</el-button>
            </el-form-item>
        </el-form>
    </div>
  </div>
</template>
<script>
import {join} from "../../Api/login/index"
export default {
  data() {
    return {
        code:""
    };
  },
  methods:{
      async Submit(){
          const {data : res} = await join(this.code)
          if(res.statusCode === 20000){
        this.$message.success(res.message)
        this.$router.push("/BasicInfomation/BreedingBase");
      }else{
        this.$message.error(res.message);
        console.error(res.message);
      }
      },
        Created(){
            this.$router.push("/CreatedBusiness");
        }
  },
   

}
</script>
<style lang="scss" scoped>
.el-button--primary {
  color: #fff;
  background-color: #FC813B;
  border-color: #FC813B;
}
#login {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: url("../../assets/image/register.png");
  background-size: cover;
}
  .title{
     position: absolute;
     top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  h1 {
      margin: 0 0 30px;
      padding: 0;
      color: rgb(77, 74, 74);
      text-align: center;
      font-size: 40px;
    }
  /deep/.box {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    // height: 25%;
    padding: 30px ;
    background: rgba(255, 255, 255, 0.719);
    box-sizing: border-box;
    box-shadow: 0 15px 25px rgba(131, 127, 127, 0.5);
    border-radius: 10px; /*登录窗口边角圆滑*/

    .el-form{
        margin: 50px 0px ;
        .el-form-item{
            .el-input__inner{
            border: 1px solid rgb(131, 175, 216);
            border-radius: 5px !important;
            background-color: rgb(251, 251, 251);
            color: rgb(22, 21, 21);
            width: 200px;
            
            }
        }
    }
  }

</style>